package top.zuli.package02.homework06;

import java.util.Scanner;

public class Demo6 {
    public static int fib(int n){
        if(n==1||n==2){
            return 1;
        }else{
            return(fib(n-1)+fib(n-2));
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个整数：");
        int n = scanner.nextInt();
        Demo6 demo = new Demo6();
        int result = demo.fib(n);
        System.out.print(n+"的斐波那契数列为："+result);
    }
}
